package com.yuehuanghun.admin.core.config.annotation.mybatislilu;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.persistence.Column;

import com.yuehuanghun.admin.core.config.filler.CurrentUserNameSupplier;
import com.yuehuanghun.framework.util.StringUtils;
import com.yuehuanghun.mybatis.milu.annotation.AttributeOptions;
import com.yuehuanghun.mybatis.milu.annotation.ExampleQuery;
import com.yuehuanghun.mybatis.milu.annotation.ExampleQuery.MatchType;
import com.yuehuanghun.mybatis.milu.annotation.Filler;

@Retention(RUNTIME)
@Target(FIELD)
public @interface CreateBy {
	
	@Column(updatable = false)
    @AttributeOptions(filler = @Filler(attributeValueSupplier = CurrentUserNameSupplier.class, fillOnInsert = true), exampleQuery = @ExampleQuery(matchType = MatchType.CONTAIN))
	String value() default StringUtils.EMPTY;
}
